package cn.jnetty.ioc.configruation;
/**
 * @author 猪哥亮
 * @email 1030681978@qq.com
 * @date 2020/4/3 15:44
 * 描述：
 */
public class JnettyConfiguration {
    private static PropertiesConfiguration properties = new PropertiesConfiguration();
    private static YmalConfiguration ymal = new YmalConfiguration();
    public static void loading(String ... files){
        for (String file : files) {
            if(file.endsWith(".properties")){
                properties.loading(file);
            }else if(file.endsWith(".yml")){
                ymal.loading(file);
            }
        }
    }
    public static String getValue(String key){
        String value = properties.getValue(key);
        if(value == null || value.endsWith("")){
            value = ymal.getValue(key);
        }
        return value;
    }

    public static void main(String[] args) {
//        loading("application1.properties");
        loading("jnetty.yml");
//        ymal.getValue("jnetty.l.j.s");
    }
}
